3.227 \(\int \cos (a+b x) \csc (c+b x) \, dx\)

Optimal. Leaf size=27 \[ \frac {\cos (a-c) \log (\sin (b x+c))}{b}-x \sin (a-c) \]

[Out]

cos(a-c)*ln(sin(b*x+c))/b-x*sin(a-c)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4581, 3475, 8} \[ \frac {\cos (a-c) \log (\sin (b x+c))}{b}-x \sin (a-c) \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x]*Csc[c + b*x],x]

[Out]

(Cos[a - c]*Log[Sin[c + b*x]])/b - x*Sin[a - c]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4581

Int[Cos[v_]*Csc[w_]^(n_.), x_Symbol] :> Dist[Cos[v - w], Int[Cot[w]*Csc[w]^(n - 1), x], x] - Dist[Sin[v - w],
Int[Csc[w]^(n - 1), x], x] /; GtQ[n, 0] && FreeQ[v - w, x] && NeQ[w, v]

Rubi steps

\begin {align*} \int \cos (a+b x) \csc (c+b x) \, dx &=\cos (a-c) \int \cot (c+b x) \, dx-\sin (a-c) \int 1 \, dx\\ &=\frac {\cos (a-c) \log (\sin (c+b x))}{b}-x \sin (a-c)\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.18, size = 58, normalized size = 2.15 \[ \frac {-2 b x \sin (a-c)-2 i \cos (a-c) \tan ^{-1}(\tan (b x+c))+\cos (a-c) \left (\log \left (\sin ^2(b x+c)\right )+2 i b x\right )}{2 b} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*x]*Csc[c + b*x],x]

[Out]

((-2*I)*ArcTan[Tan[c + b*x]]*Cos[a - c] + Cos[a - c]*((2*I)*b*x + Log[Sin[c + b*x]^2]) - 2*b*x*Sin[a - c])/(2*
b)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 30, normalized size = 1.11 \[ \frac {b x \sin \left (-a + c\right ) + \cos \left (-a + c\right ) \log \left (\frac {1}{2} \, \sin \left (b x + c\right )\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/sin(b*x+c),x, algorithm="fricas")

[Out]

(b*x*sin(-a + c) + cos(-a + c)*log(1/2*sin(b*x + c)))/b

________________________________________________________________________________________

giac [B]  time = 1.56, size = 482, normalized size = 17.85 \[ -\frac {\frac {4 \, {\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )\right )} {\left (b x + a\right )}}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} + \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2} + 1\right )} \log \left (\tan \left (b x + a\right )^{2} + 1\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} - \frac {2 \, {\left (\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{4} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{2} + 8 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{3} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{4} + \tan \left (\frac {1}{2} \, a\right )^{4} - 8 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right ) + 20 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - 8 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, c\right )^{4} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} + 8 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - 2 \, \tan \left (\frac {1}{2} \, c\right )^{2} + 1\right )} \log \left ({\left | \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right )^{2} + 4 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - 2 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (b x + a\right ) - 2 \, \tan \left (\frac {1}{2} \, a\right ) + 2 \, \tan \left (\frac {1}{2} \, c\right ) \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{4} + 4 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, a\right )^{4} + 4 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right ) + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, c\right )^{4} + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) + 1}}{2 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/sin(b*x+c),x, algorithm="giac")

[Out]

-1/2*(4*(tan(1/2*a)^2*tan(1/2*c) - tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*a) - tan(1/2*c))*(b*x + a)/(tan(1/2*a)^2*
tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^2 + 1) + (tan(1/2*a)^2*tan(1/2*c)^2 - tan(1/2*a)^2 + 4*tan(1/2*a)*tan
(1/2*c) - tan(1/2*c)^2 + 1)*log(tan(b*x + a)^2 + 1)/(tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^2 +
 1) - 2*(tan(1/2*a)^4*tan(1/2*c)^4 - 2*tan(1/2*a)^4*tan(1/2*c)^2 + 8*tan(1/2*a)^3*tan(1/2*c)^3 - 2*tan(1/2*a)^
2*tan(1/2*c)^4 + tan(1/2*a)^4 - 8*tan(1/2*a)^3*tan(1/2*c) + 20*tan(1/2*a)^2*tan(1/2*c)^2 - 8*tan(1/2*a)*tan(1/
2*c)^3 + tan(1/2*c)^4 - 2*tan(1/2*a)^2 + 8*tan(1/2*a)*tan(1/2*c) - 2*tan(1/2*c)^2 + 1)*log(abs(tan(b*x + a)*ta
n(1/2*a)^2*tan(1/2*c)^2 - tan(b*x + a)*tan(1/2*a)^2 + 4*tan(b*x + a)*tan(1/2*a)*tan(1/2*c) - 2*tan(1/2*a)^2*ta
n(1/2*c) - tan(b*x + a)*tan(1/2*c)^2 + 2*tan(1/2*a)*tan(1/2*c)^2 + tan(b*x + a) - 2*tan(1/2*a) + 2*tan(1/2*c))
)/(tan(1/2*a)^4*tan(1/2*c)^4 + 4*tan(1/2*a)^3*tan(1/2*c)^3 - tan(1/2*a)^4 + 4*tan(1/2*a)^3*tan(1/2*c) + 4*tan(
1/2*a)*tan(1/2*c)^3 - tan(1/2*c)^4 + 4*tan(1/2*a)*tan(1/2*c) + 1))/b

________________________________________________________________________________________

maple [B]  time = 1.94, size = 325, normalized size = 12.04 \[ \frac {\ln \left (\tan \left (b x +a \right ) \cos \relax (a ) \cos \relax (c )+\tan \left (b x +a \right ) \sin \relax (a ) \sin \relax (c )+\cos \relax (a ) \sin \relax (c )-\sin \relax (a ) \cos \relax (c )\right ) \cos \relax (a ) \cos \relax (c )}{b \left (\left (\cos ^{2}\relax (a )\right ) \left (\cos ^{2}\relax (c )\right )+\left (\cos ^{2}\relax (a )\right ) \left (\sin ^{2}\relax (c )\right )+\left (\cos ^{2}\relax (c )\right ) \left (\sin ^{2}\relax (a )\right )+\left (\sin ^{2}\relax (a )\right ) \left (\sin ^{2}\relax (c )\right )\right )}+\frac {\ln \left (\tan \left (b x +a \right ) \cos \relax (a ) \cos \relax (c )+\tan \left (b x +a \right ) \sin \relax (a ) \sin \relax (c )+\cos \relax (a ) \sin \relax (c )-\sin \relax (a ) \cos \relax (c )\right ) \sin \relax (a ) \sin \relax (c )}{b \left (\left (\cos ^{2}\relax (a )\right ) \left (\cos ^{2}\relax (c )\right )+\left (\cos ^{2}\relax (a )\right ) \left (\sin ^{2}\relax (c )\right )+\left (\cos ^{2}\relax (c )\right ) \left (\sin ^{2}\relax (a )\right )+\left (\sin ^{2}\relax (a )\right ) \left (\sin ^{2}\relax (c )\right )\right )}-\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right ) \cos \relax (a ) \cos \relax (c )}{2 b \left (\cos ^{2}\relax (c )+\sin ^{2}\relax (c )\right ) \left (\cos ^{2}\relax (a )+\sin ^{2}\relax (a )\right )}-\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right ) \sin \relax (a ) \sin \relax (c )}{2 b \left (\cos ^{2}\relax (c )+\sin ^{2}\relax (c )\right ) \left (\cos ^{2}\relax (a )+\sin ^{2}\relax (a )\right )}+\frac {\cos \relax (a ) \sin \relax (c ) \arctan \left (\tan \left (b x +a \right )\right )}{b \left (\cos ^{2}\relax (c )+\sin ^{2}\relax (c )\right ) \left (\cos ^{2}\relax (a )+\sin ^{2}\relax (a )\right )}-\frac {\cos \relax (c ) \sin \relax (a ) \arctan \left (\tan \left (b x +a \right )\right )}{b \left (\cos ^{2}\relax (c )+\sin ^{2}\relax (c )\right ) \left (\cos ^{2}\relax (a )+\sin ^{2}\relax (a )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x+a)/sin(b*x+c),x)

[Out]

1/b/(cos(a)^2*cos(c)^2+cos(a)^2*sin(c)^2+cos(c)^2*sin(a)^2+sin(a)^2*sin(c)^2)*ln(tan(b*x+a)*cos(a)*cos(c)+tan(
b*x+a)*sin(a)*sin(c)+cos(a)*sin(c)-sin(a)*cos(c))*cos(a)*cos(c)+1/b/(cos(a)^2*cos(c)^2+cos(a)^2*sin(c)^2+cos(c
)^2*sin(a)^2+sin(a)^2*sin(c)^2)*ln(tan(b*x+a)*cos(a)*cos(c)+tan(b*x+a)*sin(a)*sin(c)+cos(a)*sin(c)-sin(a)*cos(
c))*sin(a)*sin(c)-1/2/b/(cos(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*ln(1+tan(b*x+a)^2)*cos(a)*cos(c)-1/2/b/(cos(c)
^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*ln(1+tan(b*x+a)^2)*sin(a)*sin(c)+1/b/(cos(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*
cos(a)*sin(c)*arctan(tan(b*x+a))-1/b/(cos(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*cos(c)*sin(a)*arctan(tan(b*x+a))

________________________________________________________________________________________

maxima [B]  time = 0.36, size = 106, normalized size = 3.93 \[ \frac {2 \, b x \sin \left (-a + c\right ) + \cos \left (-a + c\right ) \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \relax (c) + \cos \relax (c)^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \relax (c) + \sin \relax (c)^{2}\right ) + \cos \left (-a + c\right ) \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \relax (c) + \cos \relax (c)^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \relax (c) + \sin \relax (c)^{2}\right )}{2 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/sin(b*x+c),x, algorithm="maxima")

[Out]

1/2*(2*b*x*sin(-a + c) + cos(-a + c)*log(cos(b*x)^2 + 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 - 2*sin(b*x)*s
in(c) + sin(c)^2) + cos(-a + c)*log(cos(b*x)^2 - 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(c)
 + sin(c)^2))/b

________________________________________________________________________________________

mupad [B]  time = 0.70, size = 115, normalized size = 4.26 \[ -x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )-x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )+\frac {\ln \left (-{\mathrm {e}}^{a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}+{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b*x)/sin(c + b*x),x)

[Out]

(log(exp(a*2i + b*x*2i) - exp(a*2i - c*2i))*(exp(c*1i - a*1i)/2 + exp(a*1i - c*1i)/2))/b - x*((exp(c*1i - a*1i
)*1i)/2 + (exp(a*1i - c*1i)*1i)/2) - x*((exp(c*1i - a*1i)*1i)/2 - (exp(a*1i - c*1i)*1i)/2)

________________________________________________________________________________________

sympy [B]  time = 8.03, size = 333, normalized size = 12.33 \[ - \left (\begin {cases} 0 & \text {for}\: b = 0 \wedge c = 0 \\x & \text {for}\: c = 0 \\0 & \text {for}\: b = 0 \\- \frac {b x \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {b x}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {c}{2} \right )} + \tan {\left (\frac {b x}{2} \right )} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {1}{\tan {\left (\frac {c}{2} \right )}} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {2 \log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \sin {\relax (a )} + \left (\begin {cases} \tilde {\infty } x & \text {for}\: b = 0 \wedge c = 0 \\\frac {\log {\left (\sin {\left (b x \right )} \right )}}{b} & \text {for}\: c = 0 \\\frac {x}{\sin {\relax (c )}} & \text {for}\: b = 0 \\\frac {2 b x \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {c}{2} \right )} + \tan {\left (\frac {b x}{2} \right )} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {c}{2} \right )} + \tan {\left (\frac {b x}{2} \right )} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {1}{\tan {\left (\frac {c}{2} \right )}} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {1}{\tan {\left (\frac {c}{2} \right )}} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \cos {\relax (a )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/sin(b*x+c),x)

[Out]

-Piecewise((0, Eq(b, 0) & Eq(c, 0)), (x, Eq(c, 0)), (0, Eq(b, 0)), (-b*x*tan(c/2)**2/(b*tan(c/2)**2 + b) + b*x
/(b*tan(c/2)**2 + b) - 2*log(tan(c/2) + tan(b*x/2))*tan(c/2)/(b*tan(c/2)**2 + b) - 2*log(tan(b*x/2) - 1/tan(c/
2))*tan(c/2)/(b*tan(c/2)**2 + b) + 2*log(tan(b*x/2)**2 + 1)*tan(c/2)/(b*tan(c/2)**2 + b), True))*sin(a) + Piec
ewise((zoo*x, Eq(b, 0) & Eq(c, 0)), (log(sin(b*x))/b, Eq(c, 0)), (x/sin(c), Eq(b, 0)), (2*b*x*tan(c/2)/(b*tan(
c/2)**2 + b) - log(tan(c/2) + tan(b*x/2))*tan(c/2)**2/(b*tan(c/2)**2 + b) + log(tan(c/2) + tan(b*x/2))/(b*tan(
c/2)**2 + b) - log(tan(b*x/2) - 1/tan(c/2))*tan(c/2)**2/(b*tan(c/2)**2 + b) + log(tan(b*x/2) - 1/tan(c/2))/(b*
tan(c/2)**2 + b) + log(tan(b*x/2)**2 + 1)*tan(c/2)**2/(b*tan(c/2)**2 + b) - log(tan(b*x/2)**2 + 1)/(b*tan(c/2)
**2 + b), True))*cos(a)

________________________________________________________________________________________